package com.example.mcp.server.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.PROPERTY,
        property = "type"
)
@JsonSubTypes({
        @JsonSubTypes.Type(value = McpInitializeRequest.class, name = "initialize"),
        @JsonSubTypes.Type(value = McpToolCallRequest.class, name = "tools/call"),
        @JsonSubTypes.Type(value = McpListToolsRequest.class, name = "tools/list"),
        @JsonSubTypes.Type(value = McpPingRequest.class, name = "ping")
})
public abstract class McpMessage {

    @JsonProperty("type")
    private String type;

    @JsonProperty("id")
    private String id;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}